<?php
$v_filter = "";
if(isset($_REQUEST['hdn_filter'])){
	$v_filter=_replace_bad_char(trim($_REQUEST['hdn_filter']));
}	
//kiem tra quyen xem NSD co quyen duoc xoa khong?
//if(!_check_permission_on_function($_SESSION['staff_id'], $_ISA_APP_CODE, _CONST_LIST_AGENCY_DELETE)){?>
	<script>
		//alert("<? echo _CONST_FUNCTION_PERMISSION_ERROR; ?>");
		//if (_MODAL_DIALOG_MODE==1){
		//	window.location = "<? echo $v_url; ?>";
		//}else{
			//window.history.back();
		//}	
	</script><?
	//exit;
//}


$v_list_category_id=null;
if(isset($_REQUEST['hdn_list_agency_id'])){
	$v_list_category_id=$_REQUEST['hdn_list_agency_id'];
}
if(_is_sqlserver()){
	$sql = "Exec Onegate_AgencyDelete ";
	$sql = $sql . "'" . $v_list_category_id . "'";
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$rs = $ado_conn->GetRow($sql); 
	$v_error = _replace_bad_char(trim($rs['RET_ERROR']));
}	
if (!is_null($v_error) and $v_error<>""){?>
	<script>
		alert("<?php echo $v_error; ?>");
		window.history.back();
	</script><?php
	exit;
}?>
<form action="index.php"  Name="f_back" method="post">
	<input type="hidden" name="fuseaction" value="DISPLAY_ALL_AGENCY">	
	<input name="hdn_filter" type="hidden" value="<?php echo $v_filter; ?>">
</form>		
<Script language="javascript">	
	document.forms(0).submit();
</Script> 


